Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

worker: rename to source worker and provide source-level status #2076

Merged
merged 16 commits into from
Sep 9, 2021

Conversation

lance6716
Copy link
Collaborator

@lance6716 lance6716 commented Sep 1, 2021

What problem does this PR solve?

close #2075

What is changed and how it works?

  • rename worker/Worker to worker/SourceWorker
  • now SourceWorker get source status, passing them to Unit.Status(*SourceStatus) to unit can calculate fields like "catchup with master"
  • now after invoking Unit.Status(*SourceStatus), unit will print status log. So if SourceWorker periodically invoke Unit.Status(*SourceStatus) the status log can be printed periodically like before

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change

Related changes

  • Need to cherry-pick to the release branch
  • Need to update release note

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 1, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Ehco1996
  • lichunzhu

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@lance6716 lance6716 changed the title [WIP] worker: rename to source worker and provide source-level status worker: rename to source worker and provide source-level status Sep 3, 2021
@lance6716 lance6716 added needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated labels Sep 3, 2021
@lance6716 lance6716 added this to the v2.1.0 milestone Sep 3, 2021
@lance6716
Copy link
Collaborator Author

/run-unit-tests

dm/worker/source_worker.go Show resolved Hide resolved
loader/loader.go Show resolved Hide resolved
pkg/utils/db.go Outdated Show resolved Hide resolved
syncer/status.go Outdated Show resolved Hide resolved
dm/worker/source_worker.go Show resolved Hide resolved
dm/worker/source_worker.go Show resolved Hide resolved
dm/worker/source_worker.go Show resolved Hide resolved
dm/worker/source_worker.go Show resolved Hide resolved
@@ -37,56 +34,34 @@ func (l *Loader) Status() interface{} {
MetaBinlog: l.metaBinlog.Load(),
MetaBinlogGTID: l.metaBinlogGTID.Load(),
}
go l.printStatus()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why use another goroutine to printstatus?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just want to reduce blocking time, but seems it's not that slowly 😂 wait for another reviewer

Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 One reviewer already commented LGTM label Sep 8, 2021
@ti-chi-bot ti-chi-bot added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels Sep 9, 2021
@lance6716
Copy link
Collaborator Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 3b38321

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #2109.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated size/XXL status/can-merge status/LGT2 Two reviewers already commented LGTM, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

optimizate countBinlogSize
4 participants